package com.kaili.db.mapper;

import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.kaili.pojo.dto.arrive.ArrivePrintNumberDTO;
import com.kaili.pojo.entity.HsEwbsStowage;
import com.kaili.pojo.entity.HsEwbsStowageDetail;
import com.kaili.pojo.entity.HsOptArrive;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.kaili.pojo.vo.ArriveEwbVO;
import com.kaili.pojo.vo.ExportArriveVO;
import com.kaili.pojo.vo.StowageVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author cgm
 * @since 2018-05-08
 */
public interface HsOptArriveMapper extends BaseMapper<HsOptArrive> {

    int insertBatch(List<HsOptArrive> list);

    /**
     * 根据条件查询查询配载单
     * @param page
     * @param search
     * @return
     */
    List<StowageVO> queryStowageArrive(Pagination page, Map search);

    /**
     * 根据配载单查询托运单
     * @param page
     * @param search
     * @return
     */
    List<ArriveEwbVO> queryArriveEwb(Pagination page, Map search);

    /**
     * 根据配载单查询托运单
     * @param search
     * @return
     */
    List<ArriveEwbVO> queryArriveEwb(Map search);

    /**
     * 根据配载单获取所有托运单
     * @param search
     * @return
     */
//    List<HsOptArrive> queryArriveEwbs(Map search);

    /**
     * 根据配载单获取配载单
     * @param search
     * @return
     */
    StowageVO getStowageByStowageNo(Map search);


    /**
     * 到件更新配载单信息
     * @return
     */
    Integer updateArriveStowage(HsEwbsStowage ewbsStowage);

    /**
     * 到件更新配载单详情
     * @param ewbsStowageDetail
     */
    Integer updateStowageDetailArrive(HsEwbsStowageDetail ewbsStowageDetail);

    /**
     * 配载单打次数
     * @param printNumberDTO
     * @return
     */
    int updataPrintStowage(ArrivePrintNumberDTO printNumberDTO);

    /**
     * 到件导出
     * @param map
     * @return
     */
    List<ExportArriveVO> exportArriveQueryList(Map map);

    /**
     * 批量获取配载单号
     * @param lists
     * @return
     */
    List<StowageVO> queryListStowage(List<Long> lists);

    List<ArriveEwbVO> queryPrintArriveEwb(Map map);

    List<StowageVO> queryStowageArrive(Map search);

    /**
     *查询未到货的运单数量
     * @param status
     * @return
     */
    int queryUnArriveEwbCount(String operationId);
}
